<?php
namespace catchAdmin\storehouse\model\search;

trait WarehousingSearch
{
    public function searchWarehousingIdAttr($query, $value, $data)
    {
        return $query->whereLike('w.warehousing_id', $value);
    }
    public function searchBatchNoAttr($query, $value, $data)
    {
        return $query->whereLike('w.batch_no', $value);
    }

    public function searchCustomerOrderTypeAttr($query, $value, $data)
    {
        return $query->where('w.customer_order_type', $value);
    }

    public function searchStatusAttr($query, $value, $data)
    {
        return $query->where('w.status', $value);
    }

    //创建日期
    public function searchCreatedAtAttr($query, $value, $data)
    {
        return $query->whereBetweenTime('w.created_at', $value[0], $value[1]);
    }
}
